package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum Is {
	
	NO(0),
	YES(1);
	
	private Integer value;
	
	private Is(Integer value){
		this.value = value;
	}

	public int toIntValue() {
		return this.value;
	}

	public static Is toValue(int value) {
		if (NO.value == value) {
			return NO;
		} else if (YES.value == value) {
			return YES;
		} else {
			throw new InvalidArgumentException("Unknown is[" + value + "].");
		}
	}
}
